#pragma once
#include "ZuiLib.h"
#include "LRefObject.h"

namespace ZuiLib {

class LLoadingControl :public LRefObject<ZLoadingControl>
{
public:

	int startAnimation(LuaFuncState& L)
	{
		pThis->StartAnimation();
		return 0;
	}

	int stopAnimation(LuaFuncState& L)
	{
		pThis->StopAnimation();
		return 0;
	}

	int isAnimating(LuaFuncState& L)
	{
		return L.lreturn(pThis->IsAnimating());
	}

	int setImage(LuaFuncState& L)
	{
		pThis->SetImage(L.arg(0).toString());
		return 0;
	}

	int setCycleFrameCount(LuaFuncState& L)
	{
		pThis->SetCycleFrameCount(L.arg(0).toInt());
		return 0;
	}

	int SetCycleTime(LuaFuncState& L)
	{
		pThis->SetCycleTime(L.arg(0).toInt());
		return 0;
	}

	BEGIN_MAP_FUNC(LLoadingControl)
		DECLARE_FUNC(startAnimation),
		DECLARE_FUNC(stopAnimation),
		DECLARE_FUNC(isAnimating),
		DECLARE_FUNC(setImage),
		DECLARE_FUNC(setCycleFrameCount),
		DECLARE_FUNC(SetCycleTime),
	END_MAP_FUNC
};

}//namespace

